class Rate < ActiveRecord::Base
  belongs_to :ratable, :polymorphic => true
  has_many :ratings

  def average_score
    votes != 0 ?  (10*Float(total_score)/votes).round/10.0 : 0
  end
  
end
